package club.calong.sanniu.service;

import club.calong.sanniu.http.request.InfoRequest;
import club.calong.sanniu.pojo.Info;
import club.calong.sanniu.repository.InfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class InfoService {

    private final InfoRepository repository;

    @Autowired
    public InfoService(InfoRepository repository) {
        this.repository = repository;
    }

    public Boolean update(Info info){
        return repository.update(info, null) == 1;
    }

    public Info one(){
        return repository.selectList(null).get(0);
    }
}
